// https://leetcode.cn/problems/intersection-of-multiple-arrays/description/

func intersection(nums [][]int) []int {
    rec := make([]int, 1000)
	for i, v := range nums[0] {
		rec[v]++
	}
	for i := 1; i < len(nums); i++ {
		for j, v := range nums[i] {
			if rev[v] == i {
				rec[v]++
			}
		}
	}
	ans := make([]int, 0)
	for i, v := range(rec) {
		if v == len(nums){
			ans = append(ans, i)
		}
	}
	return ans
}